/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package opera.InterfaceGrafica.PaineisDeCadastro;

import javax.swing.JButton;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

/**
 *
 * @author Luciano
 */
public class PnlCadastrarEquipamento_Arma extends javax.swing.JPanel {

    /**
     * Getters
     */
    public JButton getBtnCancelar(){
        return btnCancelar;
    }
    public JButton getBtnCadastrar(){
        return btnCadastrar;
    }
    public JButton getBtnVoltar(){
        return btnVoltar;
    }
    
    public JRadioButton getRdbArmaBranca(){
        return rdbArmaBranca;
    }
    public JRadioButton getRdbArmaDeFogo(){
        return rdbArmaDeFogo;
    }
    
    public JTextField getTxtAparo(){
        return txtAparo;
    }
    public JTextField getTxtCadencia(){
        return txtCadencia;
    }
    public JTextField getTxtDanoAdicional(){
        return txtDanoAdicional;
    }
    public JTextField getTxtEsquiva(){
        return txtEsquiva;
    }
    public JTextField getTxtGolpe(){
        return txtGolpe;
    }
    public JTextField getTxtTipo(){
        return txtTipo;
    }
    public JTextField getTxtTiroRapido(){
        return txtTiroRapido;
    }
    public JTextField getTxtTiroMirado(){
        return txtTiroMirado;
    }

    public void setRdbArmaBranca(JRadioButton rdbArmaBranca) {
        this.rdbArmaBranca = rdbArmaBranca;
    }

    public void setRdbArmaDeFogo(JRadioButton rdbArmaDeFogo) {
        this.rdbArmaDeFogo = rdbArmaDeFogo;
    }

    public void setTxtAparo(JTextField txtAparo) {
        this.txtAparo = txtAparo;
    }

    public void setTxtCadencia(JTextField txtCadencia) {
        this.txtCadencia = txtCadencia;
    }

    public void setTxtDanoAdicional(JTextField txtDanoAdicional) {
        this.txtDanoAdicional = txtDanoAdicional;
    }

    public void setTxtEsquiva(JTextField txtEsquiva) {
        this.txtEsquiva = txtEsquiva;
    }

    public void setTxtGolpe(JTextField txtGolpe) {
        this.txtGolpe = txtGolpe;
    }

    public void setTxtTipo(JTextField txtTipo) {
        this.txtTipo = txtTipo;
    }

    public void setTxtTiroMirado(JTextField txtTiroMirado) {
        this.txtTiroMirado = txtTiroMirado;
    }

    public void setTxtTiroRapido(JTextField txtTiroRapido) {
        this.txtTiroRapido = txtTiroRapido;
    }
    
    
    
    /**
     * Creates new form PnlCadastrarEquipamento_Arma
     */
    public PnlCadastrarEquipamento_Arma() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grpTipoDeArma = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        lblTipo = new javax.swing.JLabel();
        lblDanoAdicional = new javax.swing.JLabel();
        txtDanoAdicional = new javax.swing.JTextField();
        txtTipo = new javax.swing.JTextField();
        pnlArmaBranca = new javax.swing.JPanel();
        lblGolpe = new javax.swing.JLabel();
        lblAparo = new javax.swing.JLabel();
        lblEsquiva = new javax.swing.JLabel();
        txtEsquiva = new javax.swing.JTextField();
        txtAparo = new javax.swing.JTextField();
        txtGolpe = new javax.swing.JTextField();
        pnlArmaDeFogo = new javax.swing.JPanel();
        lblTiroRapido = new javax.swing.JLabel();
        lblTiroMirado = new javax.swing.JLabel();
        lblCadencia = new javax.swing.JLabel();
        txtTiroMirado = new javax.swing.JTextField();
        txtTiroRapido = new javax.swing.JTextField();
        txtCadencia = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        rdbArmaBranca = new javax.swing.JRadioButton();
        rdbArmaDeFogo = new javax.swing.JRadioButton();
        btnCancelar = new javax.swing.JButton();
        btnVoltar = new javax.swing.JButton();
        btnCadastrar = new javax.swing.JButton();

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Nova Arma"));

        lblTipo.setText("Tipo:");

        lblDanoAdicional.setText("Dano Adicional:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDanoAdicional)
                    .addComponent(lblTipo))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtDanoAdicional, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                    .addComponent(txtTipo))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTipo)
                    .addComponent(txtTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblDanoAdicional)
                    .addComponent(txtDanoAdicional, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlArmaBranca.setBorder(javax.swing.BorderFactory.createTitledBorder("Nova Arma Branca"));

        lblGolpe.setText("Golpe:");

        lblAparo.setText("Aparo:");

        lblEsquiva.setText("Esquiva:");

        txtGolpe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtGolpeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlArmaBrancaLayout = new javax.swing.GroupLayout(pnlArmaBranca);
        pnlArmaBranca.setLayout(pnlArmaBrancaLayout);
        pnlArmaBrancaLayout.setHorizontalGroup(
            pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlArmaBrancaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblEsquiva)
                    .addComponent(lblAparo)
                    .addComponent(lblGolpe))
                .addGap(18, 18, 18)
                .addGroup(pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtEsquiva, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                    .addComponent(txtAparo)
                    .addComponent(txtGolpe))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        pnlArmaBrancaLayout.setVerticalGroup(
            pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlArmaBrancaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblGolpe)
                    .addComponent(txtGolpe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblAparo)
                    .addComponent(txtAparo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlArmaBrancaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblEsquiva)
                    .addComponent(txtEsquiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlArmaDeFogo.setBorder(javax.swing.BorderFactory.createTitledBorder("Nova Arma de Fogo"));
        pnlArmaDeFogo.setEnabled(false);

        lblTiroRapido.setText("Tiro Rapido:");
        lblTiroRapido.setEnabled(false);

        lblTiroMirado.setText("Tiro Mirado");
        lblTiroMirado.setEnabled(false);

        lblCadencia.setText("Cadencia:");
        lblCadencia.setEnabled(false);

        txtTiroMirado.setEditable(false);

        txtTiroRapido.setEditable(false);

        txtCadencia.setEditable(false);

        javax.swing.GroupLayout pnlArmaDeFogoLayout = new javax.swing.GroupLayout(pnlArmaDeFogo);
        pnlArmaDeFogo.setLayout(pnlArmaDeFogoLayout);
        pnlArmaDeFogoLayout.setHorizontalGroup(
            pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlArmaDeFogoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblTiroRapido)
                    .addComponent(lblTiroMirado)
                    .addComponent(lblCadencia))
                .addGap(18, 18, 18)
                .addGroup(pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtTiroMirado, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                    .addComponent(txtTiroRapido)
                    .addComponent(txtCadencia))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlArmaDeFogoLayout.setVerticalGroup(
            pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlArmaDeFogoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTiroRapido)
                    .addComponent(txtTiroRapido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTiroMirado)
                    .addComponent(txtTiroMirado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlArmaDeFogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCadencia)
                    .addComponent(txtCadencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Tipo de Arma"));

        grpTipoDeArma.add(rdbArmaBranca);
        rdbArmaBranca.setSelected(true);
        rdbArmaBranca.setText("Arma Branca");
        rdbArmaBranca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdbArmaBrancaActionPerformed(evt);
            }
        });

        grpTipoDeArma.add(rdbArmaDeFogo);
        rdbArmaDeFogo.setText("Arma de Fogo");
        rdbArmaDeFogo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rdbArmaDeFogoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rdbArmaBranca)
                    .addComponent(rdbArmaDeFogo)))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rdbArmaBranca)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rdbArmaDeFogo)
                .addContainerGap(12, Short.MAX_VALUE))
        );

        btnCancelar.setText("Cancelar");

        btnVoltar.setText("Voltar");

        btnCadastrar.setText("Cadastrar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(23, 23, 23)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(btnCadastrar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(btnVoltar)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(btnCancelar))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(pnlArmaBranca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(pnlArmaDeFogo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pnlArmaBranca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlArmaDeFogo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnCancelar)
                    .addComponent(btnVoltar)
                    .addComponent(btnCadastrar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txtGolpeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtGolpeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtGolpeActionPerformed

    private void rdbArmaBrancaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbArmaBrancaActionPerformed
        // TODO add your handling code here:
        habilitarCamposArmaBranca();
    }//GEN-LAST:event_rdbArmaBrancaActionPerformed

    private void rdbArmaDeFogoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbArmaDeFogoActionPerformed
        // TODO add your handling code here:
        habilitarCamposArmaDeFogo();
    }//GEN-LAST:event_rdbArmaDeFogoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCadastrar;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnVoltar;
    private javax.swing.ButtonGroup grpTipoDeArma;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel lblAparo;
    private javax.swing.JLabel lblCadencia;
    private javax.swing.JLabel lblDanoAdicional;
    private javax.swing.JLabel lblEsquiva;
    private javax.swing.JLabel lblGolpe;
    private javax.swing.JLabel lblTipo;
    private javax.swing.JLabel lblTiroMirado;
    private javax.swing.JLabel lblTiroRapido;
    private javax.swing.JPanel pnlArmaBranca;
    private javax.swing.JPanel pnlArmaDeFogo;
    private javax.swing.JRadioButton rdbArmaBranca;
    private javax.swing.JRadioButton rdbArmaDeFogo;
    private javax.swing.JTextField txtAparo;
    private javax.swing.JTextField txtCadencia;
    private javax.swing.JTextField txtDanoAdicional;
    private javax.swing.JTextField txtEsquiva;
    private javax.swing.JTextField txtGolpe;
    private javax.swing.JTextField txtTipo;
    private javax.swing.JTextField txtTiroMirado;
    private javax.swing.JTextField txtTiroRapido;
    // End of variables declaration//GEN-END:variables

    public void habilitarCamposArmaBranca(){
        pnlArmaDeFogo.setEnabled(false);
        txtTiroRapido.setEditable(false);
        txtTiroMirado.setEditable(false);
        txtCadencia.setEditable(false);   
        lblTiroRapido.setEnabled(false);
        lblTiroMirado.setEnabled(false);
        lblCadencia.setEnabled(false);  

        pnlArmaBranca.setEnabled(true);
        txtGolpe.setEditable(true);
        txtAparo.setEditable(true);
        txtEsquiva.setEditable(true);
        lblGolpe.setEnabled(true);
        lblAparo.setEnabled(true);
        lblEsquiva.setEnabled(true);
    }
    
    public void habilitarCamposArmaDeFogo(){
        pnlArmaBranca.setEnabled(false);
        txtGolpe.setEditable(false);
        txtAparo.setEditable(false);
        txtEsquiva.setEditable(false);
        lblGolpe.setEnabled(false);
        lblAparo.setEnabled(false);
        lblEsquiva.setEnabled(false);

        pnlArmaDeFogo.setEnabled(true);
        txtTiroRapido.setEditable(true);
        txtTiroMirado.setEditable(true);
        txtCadencia.setEditable(true);
        lblTiroRapido.setEnabled(true);
        lblTiroMirado.setEnabled(true);
        lblCadencia.setEnabled(true);
    }
    

}
